package com.zhao.kafka.mysql

import org.apache.spark.storage.StorageLevel
import org.apache.spark.streaming.Seconds

/**
 * Description: 常量配置类<br/>
 * Copyright (c) ，2020 ， 赵 <br/>
 * This program is protected by copyright laws. <br/>
 * Date： 2020/12/25 10:38
 *
 * @author 柒柒
 * @version : 1.0
 */

object ConfigConstants {

  //kafka配置
  val kafkaBrokers = "node01:9092,node02:9092,node03:9092"
  val groupId = "group_test"
  val kafkaTopic = "test"
  val batchInterval = Seconds(5)
  val streamingStorageLevel = StorageLevel.MEMORY_AND_DISK_SER_2
  val kafkaKeySer = "org.apache.kafka.common.serialization.StringSerializer"
  val kafkaValueSer = "org.apache.kafka.common.serialization.StringSerializer"
  val sparkSerializer = "org.apache.spark.serializer.KryoSerializer"
  val batchSize = 16384
  val lingerMs = 1
  val bufferMemory = 33554432

  //Mysql配置
  val user = "root"
  val password = "123456"
  val url = "jdbc://mysql://node01:3306/kafka_offset"
  val driver = "com.mysql.jdbc.Driver"

  //检查点配置
  val checkpointDir = "file:///d:/checkpoint"
  val checkpointInterval = Seconds(10)

  //Redis配置
  val redisAddress = "192.168.10.203"
  val redisPort = 6379
  val redisAuth = "123qwe"
  val redisTimeout = 3000
}
